<template>
    <div>
        <!-- 搜索区 -->
        <div class="search">
            <span class="demonstration">书名：</span>
            <el-input v-model="queryParams.keyWord" placeholder="请输入内容" size="small" style="width: 200px;" />

            <el-button size="small" type="primary" icon="el-icon-search" @click="searchBook()" style="margin-left: 20px;">搜 索</el-button>
        </div>

        <!-- 表格区-->
        <el-table :data="tableData" border stripe class="table">
            <el-table-column
                prop="title"
                label="书名"
                width="180">
            </el-table-column>
            <el-table-column
                prop="author"
                label="作者"
                width="180">
            </el-table-column>
            <el-table-column
                prop="date"
                label="出版日期"
                width="180">
            </el-table-column>
            <el-table-column
                prop="press"
                label="出版社"
                width="180">
            </el-table-column>
            <el-table-column
                prop="cover"
                label="封面"
                width="230"
                :show-overflow-tooltip="true">
            </el-table-column>
            <el-table-column
                prop="abs"
                label="简介"
                width="650"
                :show-overflow-tooltip="true">
            </el-table-column>
            <el-table-column
                prop="cid"
                label="分类"
                width="180">
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
    import { list, addBook, updateBook, delBook } from "@/api/book";

    export default {
        data() {
            return {
                tableData: [],
                queryParams: {
                    keyWord: "",
                    pageNum: 1,
                    pageSize: 10
                }
            }
        },
        created() {
            this.getList();
            this.resetPathItem();
        },
        methods: {
            searchBook() {

            },
            getList() {
                list(this.queryParams).then(response => {
                    this.tableData = response.rows;
                    this.total = response.total;
                })
            },
        }
    }
</script>
